package com.nanyang.tms.dao.supplier;

import com.nanyang.tms.domain.supplier.SupplierDO;
import com.nanyang.tms.domain.supplier.SupplierProductVO;
import com.nanyang.tms.domain.supplier.SupplierQuery;
import com.nanyang.tms.domain.supplier.SupplierVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>SupplierDao.java</p>
 * <p>Description:(服务商信息)</p>
 *
 * @author lv
 * @date 2022年11月12日 下午05:10:27
 * @Copyright Copyright (c) 2020 www.nanyang.cn Inc. All rights reserved.
 */
@Mapper
public interface SupplierDao {
    /**
     * <p>deleteByPrimaryKey</p>
     * <p>Description:(根据主键删除)</p>
     *
     * @param id
     * @return int
     */
    int deleteByPrimaryKey(Long id);

    /**
     * <p>insert</p>
     * <p>Description:(新增（所有列）)</p>
     *
     * @param supplierDO
     * @return int
     */
    int insert(SupplierDO supplierDO);


    /**
     * <p>selectByPrimaryKey</p>
     * <p>Description:(根据主键查询)</p>
     *
     * @param id
     * @return SupplierDO
     */
    SupplierDO selectByPrimaryKey(Long id);
    /**
     * <p>selectByPrimaryKey</p>
     * <p>Description:(根据主键查询)</p>
     *
     * @param supplierCode
     * @return SupplierDO
     */
    SupplierVO selectByCode(String supplierCode);


    /**
     * <p>updateByPrimaryKey</p>
     * <p>Description:(修改(所有列))</p>
     *
     * @param supplierDO
     * @return int
     */
    int update(SupplierDO supplierDO);


    /**
     * <p>countSupplier</p>
     * <p>Description:总数</p>
     *
     * @param query
     * @return
     */
    Integer countSupplier(SupplierQuery query);

    /**
     * <p>listSupplier</p>
     * <p>Description:列表</p>
     *
     * @param query
     * @return
     */
    List<SupplierVO> listSupplier(SupplierQuery query);

    /**
     * 查询名称是否存在
     * @param query
     * @return
     */
    Integer queryVerifySupplierName(SupplierQuery query);

    /**
     * <p>enableState</p>
     * <p>Description:(启用)</p>
     *
     * @param supplierDO
     * @return int
     */
    int enableState(SupplierDO supplierDO);

    /**
     * <p>disableState</p>
     * <p>Description:(禁用)</p>
     *
     * @param supplierDO
     * @return int
     */
    int disableState(SupplierDO supplierDO);

    /**
     * <p>disableState</p>
     * <p>Description:(删除)</p>
     *
     * @param supplierCode
     * @return int
     */
    int removeState(String supplierCode);
    
    
    SupplierProductVO   getSupplierByProductCode(String productCode);

}